/*
* ============================================================================
*  Name     : CV8LogSMSContainer from V8LogSMSContainer.h
*  Part of  : v8Log
*  Created  : 2006-4-7 by key
*  Description:
*     Declares container control for application.
*  Version  :
*  Copyright: http:www.3gv8.com
* ============================================================================
*/

#ifndef V8LOGSMSCONTAINER_H
#define V8LOGSMSCONTAINER_H

// INCLUDES
#include <aknlists.h> // CAknSingleStyleListBox
#include <coecntrl.h>
#include <eiklbo.h>  		// MEikListBoxObserver
#include <badesca.h> 		// CDescArray
#include "TLogParse.h"
// FORWARD DECLARATIONS
class CEikLabel;        // for example labels
class CV8LogAppUi;
class CLogParse;
// CLASS DECLARATION

/**
*  CV8LogSMSContainer  container control class.
*  
*/
class CV8LogSMSContainer :	public CCoeControl, 
							public MCoeControlObserver,
							public	MEikListBoxObserver
    {
    public: // Constructors and destructor
        
        /**
        * EPOC default constructor.
        * @param aRect Frame rectangle for container.
        */
        void ConstructL(const TRect& aRect,CV8LogAppUi* aUI);

        /**
        * Destructor.
        */
        ~CV8LogSMSContainer();

    public: // New functions

    public: // Functions from base classes
	    void ShowSMSEventDetailsL();
	    void ResetEventList();
	    void ShowSMSLogList(TSort aSort);
	    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aListBoxEvent);

    private: // Functions from base classes

       /**
        * From CoeControl,SizeChanged.
        */
        void SizeChanged();

       /**
        * From CoeControl,CountComponentControls.
        */
        TInt CountComponentControls() const;

       /**
        * From CCoeControl,ComponentControl.
        */
        CCoeControl* ComponentControl(TInt aIndex) const;

       /**
        * From CCoeControl,Draw.
        */
        void Draw(const TRect& aRect) const;

		/**
		* From MCoeControlObserver
		* Acts upon changes in the hosted control's state. 
		*
		* @param	aControl	The control changing its state
		* @param	aEventType	The type of control event 
		*/
        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
        
    private: //data
	    CDesCArray* GetListBoxModel();
	    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
        
		CV8LogAppUi* ui;
		CLogParse*  iLogParse;
		TSort iOldSort;
		CAknColumnListBox*  iSmsListBox; // events list
   };

#endif

// End of File
